Skip to content

Sourcegraph - Update AccessToken schema#593

Open
marcleblanc2 wants to merge 1 commit into
1Password:mainfrom
marcleblanc2:main
Open

Sourcegraph - Update AccessToken schema#593
marcleblanc2 wants to merge 1 commit into
1Password:mainfrom
marcleblanc2:main

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Apr 22, 2026

Copy link
Copy Markdown

Overview

Updated the schema, and doc links

Type of change

  • Created a new plugin
  • Improved an existing plugin
  • Fixed a bug in an existing plugin
  • Improved contributor utilities or experience

Related Issue(s)

  • Resolves: #
  • Relates: #

How To Test

  1. Create an account on https://sourcegraph.com/search
  2. Go to your user settings and create an access token
  3. Install src-cli
  4. Run op plugin init src
  5. Locate your Sourcegraph Access Token: Import into 1Password...
  6. Enter or paste in the value of the Endpoint: Paste in https://sourcegraph.com
  7. Enter or paste in the value of the Token: Paste in the access token created earlier
  8. Run src login
$ src login
✔︎ Authenticated as <user> on <endpoint>

Entry created in 1Password desktop app:
image

Changelog

Updated plugin for Sourcegraph src-cli with new access token format, and made Endpoint a required field, as each Token is unique to a specific Endpoint.

@scottisloud scottisloud self-requested a review June 19, 2026 19:36

@scottisloud scottisloud left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the Sourcegraph plugin schema and for the detailed manual test steps — the URL updates and making Endpoint required look right for how src authenticates today.

A few things I'd like to see before we merge, non-blocking, but ideally polish up if you deem it worthwhile:

  • Token charset: Sourcegraph access tokens are hex-based and often include uppercase A–F (for example sgp_AaD80dc6E02eCAE1_d3cba16CC0F18fA14A2EFB61CbDFceEBf9fAD16b). The token field composition should include Uppercase: true in the charset, similar to plugins/github/personal_access_token.go.
  • Token length: Length: 60 doesn't match the current v3 format (sgp_{16hex}_{40hex}, 61 characters total). Legacy tokens (sgp_{40hex}) are shorter. I'd drop the fixed length and rely on Prefix: "sgp_" plus the hex charset, or pick a length that matches the format you're targeting.
  • Tests: access_token_test.go still uses a pre-sgp_ fixture. Please update the test token to a realistic sgp_-prefixed value so the tests match the schema.

nit: spacing in AlternativeNames: []string{"Website","URL"} for gofmt.

Could you also confirm make sourcegraph/validate and go test ./plugins/sourcegraph/... pass locally? I only see the signed-commits check on the PR so far.

Happy to take another look after those updates/you indicate no intent to make those optional updates.

(forgot to do this as a proper Review the first time 🤦 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants